<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script type="text/javascript">
    alert('js代码')
    let arr = [];
    let a = 3;
    console.log(typeof(a));

    let b = a;
    console.log(a, b);
    b++;
    console.log(a, b);

    let obj1 = {
        name: "zhangbing",
        age: 18
    };
    let obj2 = obj1;
    console.log(obj1, obj2);
    obj2.name = 'zhang';
    console.log(obj1, obj2);

    console.log(4 + 3 / 2);
    a = 4 + 3 / 2;
    console.log(typeof(a));
    console.log(10 < 3);
    console.log(1 == '1');
    console.log(1 === '1');
    console.log(5 + 'hi')

    function scoreJudge(score) {
        if (score < 60) {
            console.log('不及格');
            return;
        }
        if (score < 75) {
            console.log('良好');
            return;
        }
        if (score < 85) {
            console.log('很好');
            return;
        }
        console.log('优秀');
        return;
    }

    scoreJudge(score = 10);
    scoreJudge(score = 65);
    scoreJudge(score = 75);
    scoreJudge(score = 95);

    function multipleTable() {
        for (let i = 1; i <= 9; i++) {
            let o = '';
            for (let j = 1; j <= i; j++) {
                o += i + '*' + j + '=' + i * j + '  ';
            }
            console.log(o);

        }
    }
    multipleTable();

    function dayInYear(year, month, day) {
        let monthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

        if (year % 100 == 0) {
            if (year % 400 == 0) {
                monthDays[1] = 29;
            }
        } else if (year % 4 == 0) {
            monthDays[1] = 29;
        }
        let days = 0;
        for (let i = 0; i < month - 1; i++) {
            days += monthDays[i];
        }
        days += day;
        return days;
    }
    console.log(dayInYear(2000, 3, 1));
</script>

<body>

</body>

</html>